<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script> 
				var str=prompt("请输入：例如'225566'格式")
					function is(str){
						if(str.length !)=6{
							return false;
						}else if{
							str([0]==str[1]&&str[2]==str([3]&&str[4]==str[5]{
								return ture;
							}
							
						}
						return false;
					}
				 alert(is(str));
				
		</script>
	</body>
</html>

3
4
5
6
7
8
9
10
11
12
13
14
<meta charset="UTF-8">
<script>
    var str=prompt("请输入：例如'334455'格式")
    function isshunzi(str) {
        if (str.length != 6) {
            return false;
        } else if (str[0]==str[1]&&str[2]==str[3]
            && str[4]==str[5]) {
            return true
        }
        return false;
    }
    alert(isshunzi(str));
</script>